www.gusucode.com > 智睿学校网站管理系统 V2.20 > 智睿学校网站管理系统 V2.20\code\UserAdd.asp

    <!--#include file="Include/conn.asp"-->
<!--#include file="Include/Inc_Page.asp"-->
<!--#include file="Include/Fun_SqlIn.Asp"-->
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<meta http-equiv="Content-Language" content="zh-CN" />
<title>会员中心 - <%=SiteTitle%></title>
<meta name="keywords" content="<%=Sitekeywords%>" />
<meta name="description" content="<%=Sitedescription%>" />
<link href="images/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="images/zhirui.js"></script>
</head>
<body>
<%head()%>
  <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" class="main_class">
    <tr>
      <td width="240" valign="top" class="leftCenter" >
	<!--#include file="Include/login.asp"-->
       <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td class="Ma_left">关于我们</td>
        </tr>
        <tr>
          	<td align="left"><div style="margin-left:10px;"><% =WebMenu()%></div></td>
        </tr>
      </table>
	  <br>
	  </td>
      <td width="5"></td>
      <td valign="top"class="viewright">
	  <%
		dim UserName,UserID
		UserName=session("zhi_rui_s_MemName") 
		UserID=session("zhi_rui_s_userID")
		If UserName="" or UserID="" then
		Response.Redirect "UserLogin.asp"
		Response.End()
		end if
	   %>
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="25" style="border-bottom:solid 1px; margin-top:5px;" >
		  <span class="note">您的作品<font color=red><b><%=Mydb("Select Count([ID]) From [zhi_rui_s_po] Where UserID="&UserID,1)(0)%></b></font> 篇 | 未审核 <font color=red><b><%=Mydb("Select Count([ID]) From [zhi_rui_s_po] Where ViewFlag=0 and UserID="&UserID,1)(0)%></b></font> 篇</span>
		  </td>
        </tr>
      </table>
	  <% 
dim Result
Result=request.QueryString("Result")
dim ID,PhotoName,Content,ClassId,TopID,KeyWord,ViewFlag,BigPic,MaxPic,Source,AddTime,sqlp,sqlpp,rsp,rspp
ID=request.QueryString("ID")
call InfoEdit() 
%>
	  <br>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
  <form name="editForm" method="post" action="?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
  <tr>
    <td height="24" nowrap >
	<table width="99%" border="0" cellpadding="0" cellspacing="0"  idth="100%">

      <tr>
        <td width="120" height="24" align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="24" align="right">作品名称:</td>
        <td><input name="PhotoName" type="text" class="input1" id="PhotoName" style="WIDTH: 240;" value="<%=PhotoName%>" maxlength="100"></td>
      </tr>
	   <tr>
        <td height="24" align="right">关 健 字:</td>
        <td><input name="KeyWord" type="text" class="input1" id="KeyWord" style="WIDTH: 240;" value="<%=KeyWord%>" maxlength="100"></td>
      </tr>
	    <tr>
        <td height="24" align="right">作品类别:</td>
        <td>
		<select ID="ClassID" name="ClassID">
	 	<%
		call zhi_rui_s_fo_Class("zhi_rui_s_po_Class",ClassId)
	    %>
		</select>	
	   </td>
      </tr>
      <tr>
        <td height="24" align="right">作品来源:</td>
        <td><input name="Source" type="text" class="input1" style="WIDTH: 180;" value="<%=Source%>" maxlength="100"></td>
      </tr>
	  <tr>
        <td height="24" align="right"  valign="top">作品缩图:</td>
        <td>
		<input name="BigPic" type="text" class="input1" style="WIDTH: 240;" value="<%=BigPic%>" maxlength="100">
		<input type="checkbox" onClick="display('upload');" id="mox"/><label for='mox'>上传作品</label><br>
		<div id="upload" style="display:none;">			
		<iframe frameborder=0 width=290 height=25 scrolling=no src="Include/upload.asp?action=pro"></iframe>
		</div>
		</td>
      </tr>
	  <tr>
        <td height="24" align="right"  valign="top">作品主图:</td>
        <td>
		<input name="MaxPic" type="text" class="input1" style="WIDTH: 240;" value="<%=MaxPic%>" maxlength="100">
		<input type="checkbox" onClick="display('uploadphoto');" id="box"/><label for='box'>上传作品</label><br>
		<div id="uploadphoto" style="display:none;">			
		<iframe frameborder=0 width=290 height=25 scrolling=no src="Include/upload.asp?action=art"></iframe>
		</div>
		</td>
      </tr>
      <tr>
        <td height="24" align="right" valign="top">内容:<br>
        <td><textarea name="content" style="display:none" rows="1" cols="20"><%=content%></textarea>
	<IFRAME ID="eWebEditor1" SRC="../Zreditor/ewebeditor.htm?id=content&style=inzi" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="300"></IFRAME>		
	</td>
      </tr>
	  <tr>
	  <td  height="24" align="right">发布时间:</td>
	  <td colspan=4 class=b1_1><input name="AddTime" type="text" class="input1" style="WIDTH: 120;" value="<%if AddTime="" then response.write (""&now()&"") else response.write (""&AddTime&"")  end if %>" maxlength="120"> 
	  &nbsp;当前:<button class="but1" onClick="AddTime.value='<%=now%>'"><%=now%></button></td></tr>
	<tr>
      <tr>
        <td height="30" align="right">&nbsp;</td>
        <td valign="bottom"><input name="submitSaveEdit" type="submit" class="but1"  id="submitSaveEdit" value="保存" style="WIDTH: 80;" ></td>
      </tr>
      <tr>
        <td height="24" align="right">&nbsp;</td>
        <td valign="bottom">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  </form>
</table>
</BODY>
</HTML>
<%
sub InfoEdit()
  dim Action,rsRepeat,rs,sql
  Action=request.QueryString("Action")
  if Action="SaveEdit" then '保存编辑产品
    set rs = server.createobject("adodb.recordset")
    if len(trim(request.Form("PhotoName")))<1 then
      response.write ("<script language=javascript> alert('作品名称为必填项目!');history.back(-1);</script>")
      response.end
    end if
	if len(trim(request.Form("ClassId")))<1 then
      response.write ("<script language=javascript> alert('作品类别为必填项目!');history.back(-1);</script>")
      response.end
    end if
	if len(trim(request.Form("Content")))<1 then
      response.write ("<script language=javascript> alert('内容为必填项目!');history.back(-1);</script>")
      response.end
    end if
	  ClassId=trim(Request.Form("ClassId"))
	  Set rs=server.CreateObject("adodb.recordset")
	  sql="Select id,TopID From zhi_rui_s_po_Class where ID="&ClassId
	  rs.open sql,conn,1,1
	  if Not rs.bof and Not rs.eof then
	  TopID=rs("TopID")
	  end if
	  rs.close
	  if Topid<>0 then
	  Set rs=server.CreateObject("adodb.recordset")
	  sql="Select id From zhi_rui_s_po_Class where id="&TopID
	  rs.open sql,conn,1,1
	  if Not rs.bof and Not rs.eof then
	  TopID=rs("ID")
	  end if
	  rs.close
	  end if
     if Result="Add" then '创建产品
	  sql="select * from zhi_rui_s_po"
      rs.open sql,conn,1,3
      rs.addnew
	  rs("ClassId")=trim(Request.Form("ClassId"))
	  rs("TopID")=TopID
	  rs("UserID")=UserID
      rs("PhotoName")=trim(Request.Form("PhotoName"))
	  rs("KeyWord")=trim(Request.Form("KeyWord"))
	  rs("Source")=trim(Request.Form("Source"))
	  rs("BigPic")=trim(Request.Form("BigPic"))	
	  rs("MaxPic")=trim(Request.Form("MaxPic"))
	  rs("Content")=trim(Request.Form("Content"))
      rs("AddTime")=now()
	end if  
	if Result="Modify" then '修改产品
      sql="select * from zhi_rui_s_po where ID="&ID
      rs.open sql,conn,1,3
	  rs("ClassId")=trim(Request.Form("ClassId"))
	  rs("TopID")=TopID
      rs("PhotoName")=trim(Request.Form("PhotoName"))
	  rs("KeyWord")=trim(Request.Form("KeyWord"))
	  rs("Source")=trim(Request.Form("Source"))
	  rs("BigPic")=trim(Request.Form("BigPic"))
	  rs("MaxPic")=trim(Request.Form("MaxPic"))
	  rs("Content")=trim(Request.Form("Content"))
	end if
	rs.update
	rs.close
    set rs=nothing 
    response.write "<script language=javascript> alert('成功编辑作品!');location.replace('Userlist.asp');</script>"
  else '提取产品
	if Result="Modify" then
      set rs = server.createobject("adodb.recordset")
      sql="select * from zhi_rui_s_po where ID="& ID
      rs.open sql,conn,1,1
      if rs.bof and rs.eof then
        response.write ("数据库读取记录出错!")
        response.end
      end if
	  ClassId=rs("ClassId")
	  PhotoName=rs("PhotoName")
	  KeyWord=rs("KeyWord")
	  Source=rs("Source")
	  BigPic=rs("BigPic")
	  MaxPic=rs("MaxPic")
      Content=rs("Content")
      AddTime=rs("AddTime")
	  rs.close
      set rs=nothing 
    end if
  end if
end sub
	%>
	</td>
    </tr>
</table>
<%Bottom()%>
</body>
</html>